import time
from selenium import webdriver
from selenium.webdriver.common.by import By

class Webcontrol:
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://baike.baidu.com/link?url=m27glxchiM3Wh-CXI_AunitP-Gx07YH1yjggmHH45eOClHra-3a7wDZTGDHbcOTz7Xpj2g9nfN0Mi8lOyWtA7DOrvJM_Kq5RhY4N2SwA_Ci')
    def size(self):
        self.driver.set_window_size(200,200)
        self.driver.refresh()
        self.driver.minimize_window()
        time.sleep(2)
        self.driver.maximize_window()
    def close(self):
        self.driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/div/div[2]/div[1]/a/img').click()
        self.driver.close()
        time.sleep(5)
        self.driver.quit()
    def fb(self):
        self.driver.forward()
    def bk(self):
        self.driver.back()
a = Webcontrol()
a.size()
a.close()
